<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   	<div class="easyui-layout" fit="true">
		<!-- 表格上的toolbar工具条 -->
		<div id="easyui_toolbar" region="north" border="true" style="border-bottom:1px solid #999;height:32px;">
			<div style="height:5px; width:100%;"></div>
			<div style="height:10px;width:620px;float:left;"></div>
        	<input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#mm',searcher:chatInfoTable" style="width:300px"></input>
			<div id="mm">
				<div data-options="name:'ciid',iconCls:'icon-ok'">信息编号查找信息</div>
				<div data-options="name:'uid',iconCls:'icon-ok'">接受者编号查找信息</div>
				<div data-options="name:'ciaccid'">发送者编号查找信息</div>
			</div>
        	
		</div>
		<!-- 表格数据区域 -->
		
		<div region="center" border="false" data-optinos:"fit:true;" style="">
			<table id="chatInfoTable">
			
			</table>
		</div>
	</div>
	<script type="text/javascript">
		function searchskin(value,name){
			$("#chatInfoTable").edatagrid({
				url:"backadmin/chatinfo.action?op=findallchatinfo",
			    saveUrl: "backadmin/chatinfo.action?op=addchatinfo",
			    updateUrl: "backadmin/chatinfo.action?op=updatechatinfo",
			    idField:"ciid",
				pagination:true,
				pageNumber:1,
				pageSize:10,
				pageList:[10,20,30,40,50],
				fit:true,
				rownumbers:true,
				sortName:"ciid",
				title:"兑换商品信息列表",
				sortOrder:"desc",
				fitColumns:true,
				singleSelect:true,
				queryParams:{
					fname:value
				},
				columns:[[
					{field:"ciid",title:"消息编号",width:100,align:"center"},
					{field:"uid",title:"发送者编号",width:100,align:"center",editor:'text'},
					{field:"ciaccid",title:"接受者编号",width:100,align:"center",editor:'text'},
					{field:"cicontent",title:"消息内容",width:100,align:"center",editor:'text'},
					{field:"cidatetime",title:"消息发送时间",width:100,align:"center",editor:'text'},
					{field:"cstatus",title:"消息状态",width:100,align:"center",
						formatter:function(value,rec){
							if(value==1){
								return "<font>已收到</font>";
							}else{
								return "<font>未收到</font>";
							}
						}
					}
				]],
				onLoadSuccess:function(data){
					///linkbuttonAdjust();
					$("#chatInfoTable").edatagrid("fitColumns");//修复不对齐的bug
					changeStatus();
				},
				onAfterEdit:function(data){//编辑后修改linkbutton
					//linkbuttonAdjust();
					//alert("编辑后");
				}
			});
		}
		
		$(function(){
			searchskin(null,null);
		});
			
	</script>
  </body>
</html>
